package tripService;

import java.util.List;

import tripModel.City;

public class CityService {
	/*
	 * 最热旅游城市
	 */
	public static List<City> findCityToHot() {
		return City.dao.find("select id,name from city where leveltype=2 limit 8");
	}

	/*
	 * 显示所有省
	 */
	public static List<City> findAllProvince() {
		return City.dao.find("select id,name from city where leveltype=1");
	}

	/*
	 * 
	 */
	public static List<City> findCityForFirstProvince() {
		return City.dao
				.find("SELECT id,name from city WHERE parentid =(SELECT id FROM city WHERE leveltype=1 LIMIT 1)");
	}

	/*
	 * 
	 */
	public static List<City> findCityByProcince(Long id) {
		return City.dao.find("select id,name from city where parentid=?", id);
	}
}
